package org.hairball.analysis;

/**
 * Created by IntelliJ IDEA.
 * User: samnewman
 * Date: Jun 22, 2007
 * Time: 6:04:25 PM
 * To change this template use File | Settings | File Templates.
 */
public class SetterInjection {
    private String methodName;
    private String injectedClassName;


    public SetterInjection(String methodName, String injectedClassName) {
        this.methodName = methodName;
        this.injectedClassName = injectedClassName;
    }

    public String getMethodName() {
        return methodName;
    }

    public String getInjectedClassName() {
        return injectedClassName;
    }


    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SetterInjection that = (SetterInjection) o;

        if (injectedClassName != null ? !injectedClassName.equals(that.injectedClassName) : that.injectedClassName != null)
            return false;
        if (methodName != null ? !methodName.equals(that.methodName) : that.methodName != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (methodName != null ? methodName.hashCode() : 0);
        result = 31 * result + (injectedClassName != null ? injectedClassName.hashCode() : 0);
        return result;
    }
}
